<script>
import { inject, ref } from "@vue/composition-api";

export default {
  name: "ACL",
  props: {
    id: {
      type: String,
      required: true
    }
  },
  setup(props) {
    const { accessControl } = inject("app");

    const allow = ref(accessControl.has(props.id));

    return {
      allow
    };
  },
  render() {
    if (this.allow) {
      return this.$slots.default;
    }
    return null;
  }
};
</script>

<style scoped></style>
